//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

package oversim.overlay.mobisense;

import oversim.common.BaseOverlay;
import oversim.common.IOverlay;
import oversim.overlay.pastry.Pastry;
import oversim.overlay.pastry.PastryRoutingTable;
import oversim.overlay.pastry.PastryLeafSet;
import oversim.overlay.pastry.PastryNeighborhoodSet;

simple MobiSense extends Pastry
{
    parameters:
        @class(MobiSense);
        @display("i=block/circle");
        
        string boundaries;
}

simple BoundaryList
{
    parameters:
        @display("i=block/table");
}

module LBSMobiSense like IOverlay
{
    gates:
        input udpIn;   // gate from the UDP layer
        output udpOut;    // gate to the UDP layer
        input appIn;   // gate from the application
        output appOut;    // gate to the application

    submodules:
        mobisense: MobiSense {
            parameters:
                @display("p=60,52;i=block/circle");
        }
        pastryRoutingTable: PastryRoutingTable {
            parameters:
                @display("p=140,68;i=block/table");
        }
        pastryLeafSet: PastryLeafSet {
            parameters:
                @display("p=220,52;i=block/table");
        }
        pastryNeighborhoodSet: PastryNeighborhoodSet {
            parameters:
                @display("p=300,68;i=block/table");

        }
        boundaryList: BoundaryList {
            parameters:
                @display("p=360,80;i=block/table");

        }
    connections allowunconnected:
        udpIn --> mobisense.udpIn;
        udpOut <-- mobisense.udpOut;
        appIn --> mobisense.appIn;
        appOut <-- mobisense.appOut;

}

